app_name = "light_mes"
app_title = "Light Mes"
app_publisher = "qiushike"
app_description = "Light Mes for erpnext"
app_email = "qiushike1@163.com"
app_license = "mit"


doctype_js = {
    "BOM": "public/js/bom.js",
    "Employee Group" : "public/js/employee_group.js",
    "Item Attribute" : "public/js/item_attribute.js",
    "Job Card": "public/js/job_card.js",
    "Purchase Invoice": "public/js/purchase_invoice.js",
    "Work Order": "public/js/work_order.js",
}

doctype_list_js = {
    "Job Card": "public/js/job_card_list.js",
}


override_doctype_class = {
    "Job Card": "light_mes.light_mes.overrides.job_card.CustomJobCard",
    "BOM": "light_mes.light_mes.overrides.bom.CustomBOM",
    "Work Order": "light_mes.light_mes.overrides.work_order.CustomWorkOrder",
    "Stock Entry": "light_mes.light_mes.overrides.stock_entry.CustomStockEntry"
}

# Document Events
# ---------------
# Hook on document methods and events

doc_events = {
    "Item": {
 		"validate": "light_mes.doc_events.item_validate"
	},
    "Job Card": {
		"before_insert": "light_mes.doc_events.job_card_before_insert",		
	},
    "Operation": {
		"validate": "light_mes.doc_events.sync_employees_user_permission",		
	},
    "Plant Floor": {
		"validate": "light_mes.doc_events.sync_employees_user_permission",		
	},
    "Purchase Invoice": {
        "on_submit": "light_mes.light_mes.overrides.purchase_invoice.on_submit",
        "on_cancel": "light_mes.light_mes.overrides.purchase_invoice.on_cancel"
    },    
    "Stock Entry": {
        "before_save": "light_mes.light_mes.overrides.stock_entry.before_save"
    },
    "Work Order": {
		"validate": "light_mes.doc_events.work_order_validate",
	},
    "Workstation": {
		"validate": "light_mes.doc_events.sync_employees_user_permission",		
	}
}


override_whitelisted_methods = {
    "erpnext.manufacturing.doctype.work_order.work_order.make_job_card": 
        "light_mes.light_mes.overrides.work_order.make_job_card",
    "erpnext.manufacturing.doctype.work_order.work_order.make_work_order": 
        "light_mes.light_mes.overrides.work_order.make_work_order"
}

# each overriding function accepts a `data` argument;
# generated from the base implementation of the doctype dashboard,
# along with any modifications made in other Frappe apps
# override_doctype_dashboards = {
# 	"Task": "light_mes.task.get_dashboard_data"
# }
override_doctype_dashboards = {
	"Job Card": "light_mes.light_mes.overrides.job_card_dashboard.override_job_card_dashboard",
}

fixtures = [
    {
        "doctype": "Custom Field",
        "filters": [
            [
                "module", "=", "Light Mes"
            ]
        ],
    },
]